package com.linkoog.devtools.http.request.common.request_body;

import com.linkoog.devtools.http.request.common.RequestBody;
import com.linkoog.devtools.http.request.common.RequestBodyType;
import lombok.Getter;
import lombok.Setter;

import java.util.List;
import java.util.Map;

@Setter @Getter
public class UrlEncodeFormRequestBody implements RequestBody {


    private Map<String, List<String>> dataMap;

    public UrlEncodeFormRequestBody() {
    }

    public UrlEncodeFormRequestBody(Map<String, List<String>> dataMap) {
        this.dataMap = dataMap;
    }

    public static UrlEncodeFormRequestBody of(Map<String, List<String>> dataMap) {
        return new UrlEncodeFormRequestBody(dataMap);
    }

    @Override
    public RequestBodyType bodyType() {
        return RequestBodyType.URL_ENCODED_FORM;
    }

    @Override
    public String toString() {
        return "UrlEncodeHttpBody{" +
                    "dataMap=" + dataMap +
                '}';
    }
}
